<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  name: 'app',
  mounted () {
    const userInfo = window.localStorage.getItem('userInfo')
    if (userInfo) {
      const params = JSON.parse(userInfo)
      this.$store.dispatch('getUserinfo', params)
      if (this.$route.path !== '/home') this.$router.replace('/home')
    }
  }
}
</script>
<style>
#app {
  height: 100%;
}
</style>
